﻿<div id="header" style="height:auto;">
	<div style="float:left;width:300px;" id="logo">
		<img alt="" src="${resource(dir: 'images', file: 'logo1.gif')}">
	</div>
	<div style="float:right;">
		<div style="float:right;padding:2px 20px 1px 0px;">
			<sec:ifLoggedIn>
			<span>当前用户： </span><sec:username/> | <g:link controller="logout">退出</g:link>
			</sec:ifLoggedIn>
			<sec:ifNotLoggedIn>
				<span><g:link controller='login' action='auth'> 登录 </g:link></span>
			</sec:ifNotLoggedIn>
		</div>
		<sec:ifLoggedIn>
			<div>
					<g:form url='[controller: "search", action: "index"]' id="searchableForm" name="searchableForm" method="get" style="float:right;margin:2px;">
			    			<g:textField name="q" value="${params.q}" size="40"/>
			    			<select name="domainName" id="domainName">
			    				<option value="product">产品</option>
			    				<option value="knowlege">知识库</option>
			    			</select>
			    			<input type="submit" value="Search" />
					</g:form>
				</div>
			</sec:ifLoggedIn>
   	</div>
		<div style="clear: both; display: none;" class="hint"></div>
	</div>
	
	<div class="navigation" id="menu">
		<div class="ngtab clearFix">
			<sec:ifAllGranted roles="ROLE_ADMIN">
				<div class="nu" id="system">
				<g:link controller='user' action='list'>系统管理</g:link>
			</div>
			</sec:ifAllGranted>
			<sec:ifAllGranted roles="ROLE_PRODUCT">
			<div id="product"  class="nu">
				<g:link controller='product' action='filter'>产品管理</g:link>
			</div>
			</sec:ifAllGranted>
			<sec:ifLoggedIn>
				<div>
					<g:link controller="product" action="search">产品查询</g:link>
				</div>
			</sec:ifLoggedIn>
    	</div>
	</div>
 
<div style="width: auto;height:auto;display:none;" id="product_menu">
	<ul class="menu-list">
		<sec:access url="/producttype/list">
			<li>
				<g:link controller='productType' action='list'>产品类别</g:link>
			</li>
		</sec:access>
		<sec:access url="/product/list">
			<li>
				<g:link controller='product' action='filter'>产品管理</g:link>
			</li>
		</sec:access>
		
	</ul>
</div>
<div style="width: auto;height:auto;display:none;" id="system_menu">
	<ul class="menu-list">
		<sec:access url="/user/list">
			<li >
				<g:link controller='user' action='list'>用户管理</g:link>
			</li>
		</sec:access>
		<li >
			<g:link controller='role' action='list'>角色管理</g:link>
		</li>
		<li>
			<g:link controller='resource' action='list'>资源管理</g:link>
		</li>
	</ul>
</div>
<script type="text/javascript">
      $(document).ready(function(){
      		$("#system").powerFloat({target: $("#system_menu")});
      		$("#product").powerFloat({target: $("#product_menu")});
      });
 </script>